﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharingCenter.Web.Home
{
    using SharingCenter.Web.Classes;
    using SharingCenter.Web.Classes.Contact;
    using SharingCenter.Web.Classes.Profiles;

    public partial class Contacts : PageBase
    {
        protected string ta = "";
        protected int cc = 0;
        protected Guid currentUserId;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] == null)
            {
                currentUserId = Profile.UserId;
            }
            else
            {
                currentUserId = new Guid(Request.QueryString["id"]);
            }

            List<Guid> list = ContactOperations.GetContacts(currentUserId);
            cc = list.Count;
            ListView1.DataSource = list;
            ListView1.DataBind();

            Sc_Profile currentProfile = ProfileOperations.GetProfile(currentUserId);
            ltrNickName.Text = currentProfile.NickName;
            ltrNickName1.Text = ltrNickName.Text;
            ta = currentUserId == Profile.UserId ? "我" : Utility.GetTa(currentProfile.Gender);
        }
    }
}
